/*
 * guiServidor.java
 *
 * Created on 5 de mayo de 2009, 03:04 AM
 */

package gui;

import conexion.RmiServidor;
import java.io.IOException;
import java.rmi.RemoteException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;

/**
 *
 * @author  Victor
 */
public class guiServidor extends javax.swing.JFrame {
    private RmiServidor rs;
    private HabilitarServidor hs;
    private VerPerfiles vp;

    /** Creates new form guiServidor */
    public guiServidor(RmiServidor rs) throws RemoteException {
        initComponents();
       this.rs=rs;
        
    }

    public HabilitarServidor getHs() {
        return hs;
    }

    public void setHs(HabilitarServidor hs) {
        this.hs = hs;
    }

    public JScrollPane getJScrollPane1() {
        return jScrollPane1;
    }

    public void setJScrollPane1(JScrollPane jScrollPane1) {
        this.jScrollPane1 = jScrollPane1;
    }

    public JScrollPane getJScrollPane2() {
        return jScrollPane2;
    }

    public void setJScrollPane2(JScrollPane jScrollPane2) {
        this.jScrollPane2 = jScrollPane2;
    }


    public JButton getJbHabilitarServidor() {
        return jbHabilitarServidor;
    }

    public void setJbHabilitarServidor(JButton jbHabilitarServidor) {
        this.jbHabilitarServidor = jbHabilitarServidor;
    }

    public JButton getJbSalirSistema() {
        return jbSalirSistema;
    }

    public void setJbSalirSistema(JButton jbSalirSistema) {
        this.jbSalirSistema = jbSalirSistema;
    }

    public JButton getJbVerPerfiles() {
        return jbVerPerfiles;
    }

    public void setJbVerPerfiles(JButton jbVerPerfiles) {
        this.jbVerPerfiles = jbVerPerfiles;
    }

    public JTextArea getJtChat() {
        return jtChat;
    }

    public void setJtChat(JTextArea jtChat) {
        this.jtChat = jtChat;
    }



    public RmiServidor getRs() {
        return rs;
    }

    public void setRs(RmiServidor rs) {
        this.rs = rs;
    }

    public VerPerfiles getVp() {
        return vp;
    }

    public void setVp(VerPerfiles vp) {
        this.vp = vp;
    }

    public JTextArea getJtUsuarios() {
        return jtUsuarios;
    }

    public void setJtUsuarios(JTextArea jtUsuarios) {
        this.jtUsuarios = jtUsuarios;
    }

  
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jtUsuarios = new javax.swing.JTextArea();
        jbHabilitarServidor = new javax.swing.JButton();
        jbSalirSistema = new javax.swing.JButton();
        jbVerPerfiles = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        jtChat = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jtUsuarios.setColumns(20);
        jtUsuarios.setEditable(false);
        jtUsuarios.setRows(5);
        jScrollPane1.setViewportView(jtUsuarios);

        jbHabilitarServidor.setText("habilitar servidor");
        jbHabilitarServidor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbHabilitarServidorActionPerformed(evt);
            }
        });

        jbSalirSistema.setText("Salir del sistema");
        jbSalirSistema.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbSalirSistemaActionPerformed(evt);
            }
        });

        jbVerPerfiles.setText("Ver Perfiles");
        jbVerPerfiles.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbVerPerfilesActionPerformed(evt);
            }
        });

        jtChat.setColumns(20);
        jtChat.setEditable(false);
        jtChat.setRows(5);
        jScrollPane2.setViewportView(jtChat);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jbHabilitarServidor)
                        .addGap(26, 26, 26)
                        .addComponent(jbVerPerfiles)
                        .addGap(34, 34, 34)
                        .addComponent(jbSalirSistema))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(230, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbHabilitarServidor)
                    .addComponent(jbVerPerfiles)
                    .addComponent(jbSalirSistema))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbHabilitarServidorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbHabilitarServidorActionPerformed
        // TODO add your handling code here:
                this.setVisible(false);
               // hs = new HabilitarServidor(rs, this);
                hs.setVisible(true);
    }//GEN-LAST:event_jbHabilitarServidorActionPerformed

    private void jbSalirSistemaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbSalirSistemaActionPerformed
        // TODO add your handling code here:
        rs.salirSistema();
    }//GEN-LAST:event_jbSalirSistemaActionPerformed

    private void jbVerPerfilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbVerPerfilesActionPerformed
       /* try {
            // TODO add your handling code here:

            // TODO add your handling code here:
            //this.setVisible(false);
           // vp = new VerPerfiles(this);
           // vp.setVisible(true);
        } catch (ParserConfigurationException ex) {
            Logger.getLogger(guiServidor.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SAXException ex) {
            Logger.getLogger(guiServidor.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(guiServidor.class.getName()).log(Level.SEVERE, null, ex);
        }
     */

    }//GEN-LAST:event_jbVerPerfilesActionPerformed

    /**
    * @param args the command line arguments
    */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                
//            }
//        });
//    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JButton jbHabilitarServidor;
    private javax.swing.JButton jbSalirSistema;
    private javax.swing.JButton jbVerPerfiles;
    private javax.swing.JTextArea jtChat;
    private javax.swing.JTextArea jtUsuarios;
    // End of variables declaration//GEN-END:variables

}
